<template>
    <div id="dic-info">
      <main-content :edit-component-name="editComponent" :name="name" :is-tree-table="isTreeTable" :table-head="tableHead"
          :query-condition="queryCondition" :buttons="buttons"></main-content>
    </div>
</template>

<script>
  import {mapState} from 'vuex'
  import mainContent from '../../../common/main-content'
    export default {
      components:{
        mainContent
      },
      mounted(){
        this.$set(this.queryCondition[1],'url',this.buttons.target)
        this.$set(this.queryCondition[1],'permission',this.buttons.id)
      },
      computed: {
        ...mapState({
          buttons: state => state.manager.buttons
        })
      },
        name: "dic-info",
      data(){
        return{
          editComponent:'dic-edit',
          isTreeTable:true,
          name:'字典',
          queryCondition:[{
            key:'name',
            name:'字典名称',
            type:'input'
          },{
            key: 'parentId',
            name: '父级字典',
            type: 'union-select',
          }
          ],
          tableHead:[
            {
              key:'name',
              name:'字典名称',
              type:'text'
            },
            {
              key:'code',
              name:'字典编号',
              type:'text'
            },
            {
              key:'coding',
              name:'字典代码',
              type:'text'
            },
            {
              key:'desc',
              name:'字典描述',
              type:'text'
            },
            {
              key:'parentName',
              name:'父级字典名称',
              type:'text'
            },
          ]
        }
      },
    }
</script>

<style scoped>

</style>
